package main.java.model;

public class Set {
	
    //static final variables to change action id easier
    private static final int FRONT_ID = 0;
    private static final int LEFT_ID = 1;
    private static final int RIGHT_ID = 2;
    
    //static final variables sleeping time Up Gears
    private static final int SLEEPUP_FRONT_GEARS = 1600;
    private static final int SLEEPUP_LEFT_GEARS = 2000;
    private static final int SLEEPUP_RIGHT_GEARS = 2000;
    
    //static final variables sleeping time Down Gears
    private static final int SLEEPDOWN_FRONT_GEARS = 1200;
    private static final int SLEEPDOWN_LEFT_GEARS = 1600;
    private static final int SLEEPDOWN_RIGHT_GEARS = 1600;
    
    //static final variables sleeping time Up Doors
    private static final int SLEEPUP_FRONT_DOORS = 1200;
    private static final int SLEEPUP_LEFT_DOORS = 1600;
    private static final int SLEEPUP_RIGHT_DOORS = 1600;
    
    //static final variables sleeping time Down Doors
    private static final int SLEEPDOWN_FRONT_DOORS = 1200;
    private static final int SLEEPDOWN_LEFT_DOORS = 1500;
    private static final int SLEEPDOWN_RIGHT_DOORS = 1500;
    
    private Gears gears;
    private Doors doors;
    private int sleepUpGears, sleepDownGears, sleepUpDoors, sleepDownDoors;
    
    /**
     * Constructor Set
     */
    public Set(int number) {
    	//Set timers depending on the set
    	setTimers(number);
        //Instantiation of the items
        gears = new Gears(sleepUpGears, sleepDownGears);
        doors = new Doors(sleepUpDoors, sleepDownDoors);
    }
    
    /**
     * Set Timers depending on the set number
     * @param number : set number
     */
    public void setTimers(int number) {
		switch (number) {
			case FRONT_ID :
				setSleepFront();
				break;
			case LEFT_ID :
				setSleepLeft();
				break;
			case RIGHT_ID :
				setSleepRight();
				break;
			default:
				break;
		}
    }
    
    /**
     * Set each sleep timers for the Front set
     */
    public void setSleepFront()
    {
    	setSleepUpGears(SLEEPUP_FRONT_GEARS);
		setSleepDownGears(SLEEPDOWN_FRONT_GEARS);
    	setSleepUpDoors(SLEEPUP_FRONT_DOORS);
		setSleepDownDoors(SLEEPDOWN_FRONT_DOORS);
    }
    
    /**
     * Set each sleep timers for the Left set
     */
    public void setSleepLeft()
    {
    	setSleepUpGears(SLEEPUP_LEFT_GEARS);
		setSleepDownGears(SLEEPDOWN_LEFT_GEARS);
    	setSleepUpDoors(SLEEPUP_LEFT_DOORS);
		setSleepDownDoors(SLEEPDOWN_LEFT_DOORS);
    }
    
    /**
     * Set each sleep timers for the Right set
     */
    public void setSleepRight()
    {
    	setSleepUpGears(SLEEPUP_RIGHT_GEARS);
		setSleepDownGears(SLEEPDOWN_RIGHT_GEARS);
    	setSleepUpDoors(SLEEPUP_RIGHT_DOORS);
		setSleepDownDoors(SLEEPDOWN_RIGHT_DOORS);
    }

	public int getSleepUpGears() {
		return sleepUpGears;
	}

	public void setSleepUpGears(int sleepUpGears) {
		this.sleepUpGears = sleepUpGears;
	}

	public int getSleepDownGears() {
		return sleepDownGears;
	}

	public void setSleepDownGears(int sleepDownGears) {
		this.sleepDownGears = sleepDownGears;
	}

	public int getSleepUpDoors() {
		return sleepUpDoors;
	}

	public void setSleepUpDoors(int sleepUpDoors) {
		this.sleepUpDoors = sleepUpDoors;
	}

	public int getSleepDownDoors() {
		return sleepDownDoors;
	}

	public void setSleepDownDoors(int sleepDownDoors) {
		this.sleepDownDoors = sleepDownDoors;
	}

	public Gears getGears() {
        return gears;
    }

    public void setGears(Gears gears) {
        this.gears = gears;
    }

    public Doors getDoors() {
        return doors;
    }

    public void setDoors(Doors doors) {
        this.doors = doors;
    }
}
